using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class LevelChoose : MonoBehaviour
{
    public Button Level1;
    public Button Level2;
    public Button Level3;
    public Button Level4;

    
    private void Start()
    {
        Level1.onClick.AddListener(() => Leveldiliver(1));
        Level2.onClick.AddListener(() => Leveldiliver(2));
        Level3.onClick.AddListener(() => Leveldiliver(3));
        Level4.onClick.AddListener(() => Leveldiliver(4));
    }
    
    public void Leveldiliver(int scene)
    {
        PlayerPrefs.SetInt("scene", scene - 1);
        Debug.Log(scene);
        ScreenChange();
    }
    public void ScreenChange()
    {
        SceneManager.LoadScene("Main");
    }
}
